import { gql } from '@apollo/client/core';

export const query = gql`
	query browse($arrivalTime: Date!, $status: ReservationStatus!) {
		browse(arrivalTime: $arrivalTime, status: $status) {
			_id
			guestName
			contactInfo
			reservedSize
			reservedBy
			arrivalTime
			status
		}
	}
`;

export const detail = gql`
	query detail($id: ID!) {
		detail(id: $id) {
			_id
			guestName
			contactInfo
			reservedSize
			reservedBy
			arrivalTime
			status
		}
	}
`;

export const update = gql`
	mutation updateReservation($input: BookReservation!, $id: ID!) {
		update(id: $id, reservation: $input) {
			_id
			guestName
			contactInfo
			reservedSize
			reservedBy
			arrivalTime
			status
		}
	}
`;

export const remove = gql`
	mutation remove($id: ID!) {
		cancel(id: $id) {
			_id
			guestName
			contactInfo
			reservedSize
			reservedBy
			arrivalTime
			status
		}
	}
`;

export const add = gql`
	mutation book($reservation: BookReservation!) {
		book(reservation: $reservation) {
			_id
			guestName
			contactInfo
			reservedSize
			reservedBy
			arrivalTime
			status
		}
	}
`;
